package org.opens.controller;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PageController {

    @RequestMapping(value = "/")
    public String goIndex() {
        return "index";
    }

    @RequestMapping(value = "/login")
    public String goLogin() {
        return "login";
    }

    @RequestMapping(value = "/logout")
    public String logout() {
        SecurityUtils.getSubject().logout();
        return "redirect:/";
    }

    @RequestMapping(value = "/403")
    public String goNoPermission() {
        return "403";
    }

    @RequestMapping(value = "/success")
    public String goSuccess() {
        return "success";
    }

    @RequestMapping(value = "/page")
    public String goPage() {
        return "page";
    }

    @RequestMapping(value = "/rate")
    public String goRateLimit() {
        return "RateLimit";
    }

}
